<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/* 
 * License: TT Tech
 * Website: www.thientan.de
 */

class ModuleTeaserMedia extends Module
{
    protected $strTemplate = "teaser_media";

    protected function compile()
    {
 
        // $GLOBALS['TL_CSS'][] = 'system/modules/hotuy_media/html/css/media.css';
    	$strQuery = "select * from tl_module where media_id = ?";
        $objResult = $this->Database->prepare($strQuery)->execute($this->media_id);
        if($objResult->numRows < 1) $arrResult = array();
        while($objResult -> next())
        {
        	 $description=deserialize($objResult->media_description);
        	 $headline=deserialize($objResult->media_headline);
        	 $arrResult = array(
        	 'media_headline' 		=> $headline[$GLOBALS['TL_LANGUAGE']],
        	 'media_description' 	=> $description[$GLOBALS['TL_LANGUAGE']],
        	 );
        }
      	if($this->media_autostart=='1')
		{
			$autostart="true";
		}
	  	else {$autostart="false";};
	 	if($this->media_link!='' & $this->media_linkurl =='')
		{
			$link=$this->media_link;
		}
		else if($this->media_link =='' & $this-> media_linkurl !='')
		{
			$linkurl=$this->media_linkurl;
		}
		else {$link=$this->media_link;};
    	$this->Template->id = $this->media_id;
        $this->Template->width=$this->media_with;
        $this->Template->height=$this->media_height;
        $this->Template->start=$autostart;
        $this->Template->link=$link;
        $this->Template->linkurl=$linkurl;
        $this->Template->arrResult=$arrResult;
        
     }
}
?>
